<template>
  <div class="pbox">
    <h1>{{pmsg}}--->{{num}}</h1>
    <Child :fromParentMsg="pmsg" @make="getChildMsg"></Child>
  </div>
</template>

<script lang='ts'>
import Child from './components/Child.vue';
import {ref} from 'vue'
export default{
    setup() {
        let pmsg=ref<string>('父组件的信息')
        return {pmsg};
    },
    data(){
      return{
        num:0
      }
    },
    methods:{
      getChildMsg(val:number){
        this.num=val
      }
    },
    components: { Child }
}
</script>

<style lang='scss' scoped>
.pbox{
  width: 300px;
  height: 200px;
  background-color: tomato;
}
</style>